package router

import (
	_ "gin-sns/app/controller/admin/demo"
	"gin-sns/app/controller/admin/hello"
	_ "gin-sns/app/controller/admin/module"
	_ "gin-sns/app/controller/admin/monitor"
	"gin-sns/app/controller/admin/system"
	_ "gin-sns/app/controller/admin/system"
	_ "gin-sns/app/controller/api"
	_ "gin-sns/app/controller/api/module"

	//errorc "gin-sns/app/controller/system/error"

	_ "gin-sns/app/controller/admin/tool"
	"gin-sns/app/ginframe/router"
	"gin-sns/app/service/middleware/auth"
)

func init() {
	// 加载登陆路由
	g1 := router.New("admin", "/")
	g1.ANY("/", "", hello.HelloController.Hello)
	g1.GET("/login", "", system.LoginController.Login)
	g1.GET("/captchaImage", "", system.LoginController.CaptchaImage)
	g1.POST("/checklogin", "", system.LoginController.CheckLogin)
	g1.GET("/500", "", system.ErrorController.Error)
	g1.GET("/404", "", system.ErrorController.NotFound)
	g1.GET("/403", "", system.ErrorController.Unauth)
	g1.GET("/index", "", system.IndexController.Index)
	g1.GET("/logout", "", system.IndexController.Logout)

	// 加载框架路由
	g2 := router.New("admin", "/system", auth.Auth)
	g2.GET("/main", "", system.IndexController.Main)
	g2.GET("/switchSkin", "", system.IndexController.SwitchSkin)
	g2.GET("/download", "", system.IndexController.Download)
}
